export function getNowDate(dateTime) {
	let date = new Date(dateTime);
	let year = date.getFullYear();
	let month = date.getMonth() + 1;
	let day = date.getDate();
	if (month.toString().length == 1) {
		month = "0" + month;
	}
	if (day.toString().length == 1) {
		day = "0" + day;
	}
	return year + "-" + month + "-" + day;
}

export function getNowTime(dateTime) {
	let date = new Date(dateTime);
	let hours = date.getHours();
	let min = date.getMinutes();
	// let sec = date.getSeconds();

	if (hours.toString().length == 1) {
		hours = "0" + hours;
	}
	if (min.toString().length == 1) {
		min = "0" + min;
	}
	return hours + ":" + min;
}

export function sleep(time) {
	return new Promise((resolve, reject) => {
		setTimeout(() => {
			resolve(true)
		}, time)
	})
}
